package javass;

import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
/**
 * ��ý��
 * @author Administrator
 *
 */
public class ResultSetUtil {
	ResultSet rs=null;
	/**
	 * ͨ��Statement��ý��
	 * @param sm
	 * @param sql
	 * @return
	 * @throws SQLException
	 */
	public ResultSet getResultSet(Statement sm,String sql) throws SQLException{
		rs=sm.executeQuery(sql);
		return rs;
	}
	/**
	 * ͨ��PreparedStatement��ý��
	 * ����������
	 * @param psm
	 * @return
	 * @throws SQLException
	 */
	public ResultSet getResultSet(PreparedStatement psm) throws SQLException{
		rs=psm.executeQuery();
		return rs;
	}
	/**
	 * �رս��
	 * @throws SQLException
	 */
	public void closeResultSet() throws SQLException{
		rs.close();
	}

}
